package com.button.boot.redis.jedis.controller;

import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.button.boot.redis.jedis.service.RedisManager;

@RestController
public class RedisController {
    @Autowired
    private RedisManager redisManager;

    @GetMapping("/getValue")
    public String getValue(String key) {
        return redisManager.valueGet(key);
    }
    @GetMapping("/setValue")
    public void getValue(String key, String value) {
        redisManager.valueSet(key, value, 10, TimeUnit.MINUTES);
    }
}
